package com.lili.operate.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lili.common.result.Result;
import com.lili.model.operate.FeedBack;
import com.lili.operate.service.FeedbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/admin")
@Api(tags = "会员意见反馈管理模块")
public class FeedbackController {
    @Autowired
    FeedbackService feedbackService;

    @ApiOperation("查询所有的会员意见反馈")
    @PostMapping("/query/feedback")
    public Result queryFeedback(@RequestBody Map map){
        Page<FeedBack> page = feedbackService.queryFeedback(map);
        return page==null?Result.fail():Result.ok(page);
    }
}
